<?php
namespace app\manage\validate;

use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'realname'  =>  'require|chs|length:2,10',
        'phone'     =>  'require|unique:admin|length:2,30',
//        'phone'     =>  'require|unique:admin|regex:/^1[3456789]{1}\d{9}$/',
    ];


    protected $message  =   [
        'realname.require' => '姓名必须',
        'realname.length'  => '姓名2-10个字符',
        'realname.chs'     => '姓名必须是汉字',
        'phone.require'     => '用户名必须',
        'phone.unique'     => '用户名必须唯一',
        'phone.length'     => '用户名2-30个字符',
    ];

}